//
//  GB_SettingViewController.m
//  MELive
//
//  Created by 郭宝 on 16/10/20.
//  Copyright © 2016年 曹曹. All rights reserved.
//

#import "GB_SettingViewController.h"
#import "GB_SettingTableViewCell.h"
@interface GB_SettingViewController () <UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic ,strong) NSArray *array;
@end

@implementation GB_SettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self createView];
}
- (void)createView {
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"loginBack50px"] imageWithRenderingMode:1] style:UIBarButtonItemStylePlain target:self action:@selector(didBackAction:)];
    self.navigationItem.title = @"设置";
    [_tableView registerNib:[UINib nibWithNibName:@"GB_SettingTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"GB_SettingTableViewCell"];
    _array = @[@"头像", @"昵称", @"ME号", @"性别", @"个性签名"];
}
- (void)didBackAction:(UIBarButtonItem *)barButtonItem {
    self.navigationController.navigationBar.hidden = YES;
    [self.navigationController popViewControllerAnimated:YES];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _array.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    GB_SettingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"GB_SettingTableViewCell" forIndexPath:indexPath];
     cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    if (indexPath.row == 0) {
        cell.contentLabel.hidden = YES;
    } else {
        cell.headImageView.hidden = YES;
    }
    cell.columnLabel.text = _array[indexPath.row];
    return cell;
}
- (void)creatNavBar {
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"loginBack50px"] imageWithRenderingMode:1] style:UIBarButtonItemStylePlain target:self action:@selector(didHeadAction:)];

}
- (void)didHeadAction:(UIBarButtonItem *)head {
    self.navigationController.navigationBar.hidden = YES;
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
